﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;
using System.Windows.Forms;
using HotelSoft.HotelManagement_BUS;
using HotelSoft.HotelManagement_DTO;

namespace HotelSoft.HotelManagement_GUI
{
    public partial class frmReport_HoaDon : Form
    {
        HoaDon_ThanhToanBUS bus = new HoaDon_ThanhToanBUS();
        private string iSoHD;
        private string iSoPDK, iMasoNV;
        private float iTongTien;
        private DateTime iNgayThanhToan;

        public string SoHD
        {
            get { return iSoHD; }
            set { iSoHD = value; }
        }
        //public string SoPDK
        //{
        //    get { return iSoPDK; }
        //    set { iSoPDK = value; }
        //}
        //public string MasoNV
        //{
        //    get { return iMasoNV; }
        //    set { iMasoNV = value; }
        //}
        //public float TongTien
        //{
        //    get { return iTongTien; }
        //    set { iTongTien = value; }
        //}
        //public DateTime NgayThanhToan
        //{
        //    get { return iNgayThanhToan; }
        //    set { iNgayThanhToan = value; }
        //}

        public frmReport_HoaDon()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Viewphong_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            docBaoCaoHD = new rptReport_HoaDon();
            string s = Application.StartupPath + "\\rptReport_HoaDon.rpt";
            docBaoCaoHD.Load(s);

            HoaDon_ThanhToanDTO dto = new HoaDon_ThanhToanDTO();
            dto.SoHD = SoHD;
            
            dt = bus.LayDSHoaDon(dto);
            docBaoCaoHD.Database.Tables["command"].SetDataSource(dt);
            Viewphong.ReportSource = docBaoCaoHD;
           // docBaocaoHD.SetParameterValue("txtHinhthuc", "THÁNG " + "(" + dto.THANG + "/" + dto.NAM + ")"); 
        }

        private void frmReport_HoaDon_Load(object sender, EventArgs e)
        {
            CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
            culture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
            Thread.CurrentThread.CurrentCulture = culture;
        }

    }
}
